import React, {Component} from 'react';
import {HashRouter as Router, Redirect, Route, Switch} from 'react-router-dom';
import './App.css';
import Home from './views/home/Home';
import Login from './views/login/Login';
import TodoApp from './views/todo-app/TodoApp';
import Error500 from './views/error/Error500';
import TodoMobx from "./views/todo-mobx/TodoMobx";
import Loading from "./components/loading/Loading";

class App extends Component {
  render () {
    return (
      <React.Fragment>
        <Router>
          <div className="App">
            <Switch>
              <Route path={'/home'} component={Home}/>
              <Route path={'/login'} component={Login}/>
              <Route path={'/todo-app'} component={TodoApp}/>
              <Route path={'/todo-mobx'} component={TodoMobx}/>
              <Route path={'/500'} component={Error500}/>
              <Redirect from={'/'} to={'/home'}/>
            </Switch>
          </div>
        </Router>
        <Loading/>
      </React.Fragment>
    );
  }
}

export default App;
